{extend name="layout" /}
{block name="content"}
<!-- Content Header (Page header) -->
<section class="content" style="padding-top:0;padding-bottom: 0">
<div class="row" style="padding-bottom: 0">
  <div class="box" style="margin-bottom: 0">
    <div class="box-header with-border">
      <h3 class="box-title"><i class="fa fa-building-o"></i> Banner图管理</h3>
    </div>
    <!-- /.box-header -->
    <div class="box-body">
        <div class="row">
          <div class="col-xs-3">
            <form>
            <div class="input-group input-group-sm">
                <input type="text" class="form-control input-sm" name="keywords">
                <span class="input-group-btn">
                  <button type="button" class="btn btn-info btn-flat searchBtn" pageid="pages">搜  索</button>
                  <!-- <button type="button" class="btn btn-danger btn-flat cocoModal" isForm url="{:url('search')}">高级搜索</button> -->
                </span>
            </div>
            <input type="hidden" name="fieldset" value="keywords-name|apikey|weburl-like">
            </form>
          </div>
          <div class="col-xs-9" style="text-align: right">
            <button type="button" class="btn btn-success btn-sm cocoModal" isForm url="{:url('add')}" title="新增项目" ><i class="fa fa-plus"></i> 新增</button>
            <!-- <button type="button" class="btn btn-info btn-sm cocoModal" checkItem="1:1" isForm url="{:url('edit',array('model'=>$model))}"><i class="fa fa-edit"></i> 编辑</button>
            <button type="button" class="btn btn-danger btn-sm cocoAjax" confirm="确定要删除吗？" checkItem="1:0" ajaxUrl="{:url('data_delete',array('model'=>$model))}"><i class="fa fa-remove"></i> 删除</button> -->
          </div>
        </div>
      <table class="layui-table" class="layui-table" lay-data="{height: 'full-75', cellMinWidth: 80, page: true, id:'lists',limit:30, url:'{:url('data_show_where',['order'=>'desc'])}'}" lay-filter="lists">
        <colgroup>
          <col width="35">
          <col width="30">
        </colgroup>
        <thead>
        <tr>
          <th lay-data="{type:'checkbox'}">ID</th>
          <th lay-data="{field:'id', sort: true, fixed: 'right', width:80, align:'center'}">ID</th>
          <th lay-data="{field:'title', width:160}">标题</th>
          <th lay-data="{field:'type', width:100}">类型</th>
          <th lay-data="{field:'description'}">简介</th>
          <!-- <th field="statusType">状态</th> -->
          <th lay-data="{field:'thumb'}">图片</th>
          <!-- <th lay-data="{field:'video'}">视频</th> -->
          <th lay-data="{field:'linkurl'}">链接地址</th>
          <th lay-data="{field:'addtime'}">添加时间</th>
          <th lay-data="{fixed: 'right', width:200, align:'center', toolbar: '#barDemo'}">操作</th>
        </tr>
        </thead>
        <tbody id="datalist">
        </tbody>
      </table>
      <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-xs" lay-event="show_image">查看图片</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
      </script>
    </div>
    <!-- /.box-body -->
    <div id="pages" class="box-footer clearfix pages" style="text-align: center;padding:0"></div>
  </div>
</div>
</section>
<!-- /.content -->
{/block}
{block name="script"}
<script type="text/javascript">
  function show_image(data) {
    var layindex = layer.open({
      type: 2,
      area: ['800px', '700px'],
      fixed: false, //不固定
      maxmin: true,
      content: APP_URL+"/admin/lunbo/image?id="+data.id,
      title:'banner图片',
      shade: [0.8, '#000000']
    });
  }
</script>
{/block}